package org.kernely.security.ui.administration;

import org.kernely.security.ui.group.mgmt.GroupManagementPresenter;
import org.kernely.security.ui.group.mgmt.GroupManagementView;
import org.kernely.security.ui.user.mgmt.UserManagementPresenter;
import org.kernely.security.ui.user.mgmt.UserManagementView;
import org.kernely.ui.mvp.KernelyPresenter;

import com.vaadin.ui.Layout;

public class SecurityAdministrationPresenter extends KernelyPresenter<SecurityAdministrationView>{

	/**
	 * @see org.kernely.ui.mvp.IKernelyPresenter#bind()
	 */
	@Override
	public final void bind() {
		// Create the users tab
		UserManagementPresenter ump = new UserManagementPresenter();
		UserManagementView umv = new UserManagementView();
		ump.setView(umv);
		
		// Create the groups tab
		GroupManagementPresenter gmp = new GroupManagementPresenter();
		GroupManagementView gmv = new GroupManagementView();
		gmp.setView(gmv);
		
		// Adds the tabs into the tabsheet
		view.getTabSheet().addTab((Layout)ump.getView(), "Users", null);
		view.getTabSheet().addTab((Layout)gmp.getView(), "Groups", null);
	}
}